{extend name='admin@public/content'}

{block name="content"}
<form autocomplete="off" onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='form-horizontal layui-form padding-top-20'>

    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <div class="form-group">
                    <label class="col-sm-2 control-label">物品名称</label>
                    <div class='col-sm-8'>
                        <input autofocus name="name" value='{$vo.name|default=""}' title="请输入名称" placeholder="请输入名称" class="layui-input">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">物品分类</label>
                    <div class='col-sm-8'>
                        <select required class="layui-select full-width" name="type">
                            {foreach $cates as $cate}
                            <!--{eq name='$cate.id' value='$vo.type|default=0'}-->
                            <option selected="selected" value="{$cate.id}">{$cate.title}</option>
                            <!--{else}-->
                            <option value="{$cate.id}">{$cate.title}</option>
                            <!--{/eq}-->
                            {/foreach}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">状态</label>
                    <div class='col-sm-8'>
                        <label class="think-radio"><input lay-ignore type="radio" {$vo['status']=='0'?'checked':''} value="0" name="status"/> 待审核</label>
                        <label class="think-radio"><input lay-ignore type="radio" {$vo['status']=='1'?'checked':''} value="1" name="status"/> 抢单中</label>
                        <label class="think-radio"><input lay-ignore type="radio" {$vo['status']=='2'?'checked':''} value="2" name="status"/> 已结束</label>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">数量</label>
                    <div class='col-sm-8'>
                        <input autofocus name="number" value='{$vo.number|default=""}' title="请输入数量" placeholder="请输入数量" class="layui-input">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">型号</label>
                    <div class='col-sm-8'>
                        <input autofocus name="model" value='{$vo.model|default=""}' title="请输入型号" placeholder="请输入型号" class="layui-input">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">运输方式</label>
                    <div class='col-sm-8'>
                        <input autofocus name="shipping" value='{$vo.shipping|default=""}' title="请输入运输方式" placeholder="请输入运输方式" class="layui-input">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">地址</label>
                    <div class='col-sm-8'>
                        <input autofocus name="address" value='{$vo.address|default=""}' title="请输入地址" placeholder="请输入地址" class="layui-input">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">支付方式</label>
                    <div class='col-sm-8'>
                        <input autofocus name="pay_type" value='{$vo.pay_type|default=""}' title="请输入支付方式" placeholder="请输入支付方式" class="layui-input">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">抢单结束时间</label>
                    <div class='col-sm-8'>
                        <input autofocus name="grab_sheet_end_time" readonly value='{$vo.grab_sheet_end_time|date="Y-m-d H:i:s"}' title="请选择结束时间" placeholder="请选择结束时间" class="layui-input">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label label-required">图片</label>
                    <div class='col-sm-8'>
                        <table class="layui-table background-item margin-none" lay-size="sm" lay-skin="nob">
                            <thead>
                            <tr>
                                <td>图片</td>
                            </tr>
                            </thead>
                            <tbody>
                            <tr>
                                <td class="text-top">
                                    <input type="hidden" name="image" value="{$vo.image|default=''}">
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <script>
                    $('input[name="image"]').uploadMultipleImage();
                </script>
                <div class="form-group">
                    <label class="col-sm-2 control-label">描述</label>
                    <div class='col-sm-8'>
                        <textarea name="desc" class="form-control">{$vo.desc|default=''|htmlspecialchars_decode}</textarea>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="hr-line-dashed"></div>

    <div class="col-sm-7 col-sm-offset-2">
        <div class="layui-form-item text-center">
            {if !empty($vo.id)}
            <input type="hidden" name="id" value="{$vo.id}">
            <input type="hidden" name="mid" value="{$vo.mid}">
            {/if}
            <button class="layui-btn" type="submit">保存</button>
            <button class="layui-btn layui-btn-danger" type='button' onclick="window.history.back()">取消</button>
        </div>
    </div>

    <style>
        .background-item {
            padding: 15px;
            background: #efefef;
        }
        .no_border{border:none;}
        .background-item thead tr {
            background: #e0e0e0
        }
    </style>
    <script>
        window.form.render();
        layui.use('laydate', function(){
            var laydate = layui.laydate;

            laydate.render({
                elem: 'input[name=grab_sheet_end_time]',
                btns: ['now', 'confirm'],
                type: 'datetime'
            });
        });
    </script>
</form>
{/block}